#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
using namespace std;

class Solution{
    private:
    unordered_map<int, string> map = {
        {2, "abc"},
        {3, "def"},
        {4, "ghi"},
        {5, "jkl"},
        {6, "mno"},
        {7, "pqrs"},
        {8, "tuv"},
        {9, "wxyz"}
    };
    
    vector<string> ret;

    public:
    vector<string> ans1(string digits){
        add("", 0, digits);

        return ret;
        
    }

    void add(string str, int index, string digits){
        if(index == digits.size()){
            ret.push_back(str);
        }else{
            string temp = map[digits[index] - '0'];
            for(char ch: temp){
                str = str + ch;
                add(str, index+1, digits);
                str.pop_back();
            }
        }
    }
};

void test(){
    Solution s;
    string digits = "23";

    vector<string> ret = s.ans1(digits);
    int len = ret.size();
    for(int i = 0; i != len; i++){
        cout << ret[i] << endl;
    }

}

int main(void){
    test();

    return 0;
}